< previous page page_312 next page >

Page 312
e10a6a0a59f035e870d90cca05b85fce.gif
               .rgbGreen = (clr And &HFFOO&) \ &H100&
               .rgbBlue = (clr And &HFF0000) \ &H10000
           End With

           ImaC = ImaC + dImaC
       Next j
       ReaC = ReaC + dReaC

       ' Let the user know we're not dead.
       If i Mod 10 = 0 Then
           picCanvas.Line (0, 0)-(wid, i), vbWhite, BF
           picCanvas.Refresh 
       End If
   Next i

   ' Update the image. 
   SetBitmapPixels picCanvas, bits_per_pixel, pixels
   picCanvas.Refresh
   picCanvas.Picture = picCanvas.Image

   Caption = "Mand (" & Format$(m_Xmin) & ", "& _
       Format$(m_Ymin) & ")-(" & _
       Format$(m_Xmax) & ", " & _
       Format$(m_Ymax) & ")"
End Sub
Example program Mand uses this subroutine to draw the Mandelbrot set. If you click and drag to select part of the image, the program zooms in on that area. You can later use the Scale menu's x2, x4, x8, and Full Scale commands to zoom out so that you can see more of the Mandelbrot set. You can save the image displayed by selecting Save As from the File menu.
The program can also save a series of images for animation. First, zoom in on an area of the Mandelbrot set that you find interesting. Then select the Movie menu's Create Movie command. The program then asks you to select a filename to use as the base name for the images. For instance, if you specify the file C:\Temp\Mand1, the program saves the movie frames in the files C:\Temp\Mand1_0.bmp, C:\Temp\Mand1_1.bmp, and so forth.
Next the program asks you how many images you want to create. After you have entered a value, the program creates the series of images. The first image is at full scale centered on the area you are currently displaying. Subsequent images zoom in on your selected area.
The Options menu's Set Options command lets you select colors and specify the maximum number of iterations the program performs when computing pixel values. This number determines how many values of Zn the program calculates before it decides that the magnitude of Zn is probably not heading toward infinity. Smaller values make the program run more quickly. You might want to set this value to something small, like 64 or even 16, while you are exploring the Mandelbrot set. Once you have found an interesting area, you can increase this value to 128 or 512 to see more detail.

 
< previous page page_312 next page >